<div style="width:500px; text-align:left">
  <h1><%=t 'wanna_order'%></h1>
  <% prefix = 'order'%>
  <% form_for @order do |f| %>
    <%= f.error_messages %>
    <%= hidden_field_tag('_method', 'put') unless @order.new_record? %>
    <% fields_for 'order[restaurant]',@order.restaurant do |r|%>
    <p>
      <%=t 'restaurant'%><%= r.text_field :name%>
    </p>
    <p>
      <%=t 'telephone'%><%= r.text_field :telephone%>
    </p>
    <% end %>
    <% fields_for 'order[orderee]',@order.orderee do |o|%>
      <p>
        <%=t 'username'%><%= o.text_field :name%>
      </p>
      <p>
        <%=t 'telephone'%><%= o.text_field :telephone%>
      </p>
    <% end %>
    <p>
      <%= f.label :address%>&nbsp;<%= f.text_field :address %>
    </p>
    <p>
      <%=t 'i_wanna_order'%>
      <%= link_to_remote t('add'), {:url => { :action => "new_item"}, 
              :update => :items, :position => :bottom}, :id => "add_new_item_link" %>
      <ul class="item-container" id="items">
        <%= render :partial => "item", :collection => @items %>
      </ul>
    </p>
    <p>
      <%= f.label :total_price %>&nbsp;<%= f.text_field :total_price %>
    </p>
    <p>
      <%= f.label :comments%><br />
      <%= f.text_area :comments%>
    </p>
    <p>
      <%= f.submit "Save" %>
    </p>
  <% end %>
  
  <%= link_to 'Back', orders_path %>
</div>